//
//  UIFactory.swift
//  sinaweiboFirst
//
//  Created by mac on 16/3/10.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit
//抽象类
//所有UI控件都是通过这个类来进行实例化 NSNumber

class UIFactory {
    
    //抽象方法
    class func labelFactory(text: String,textColor: UIColor,fontSize: CGFloat,alignment: NSTextAlignment = .Center) -> UILabel {
        let lab = UILabel.labelWith(text, textColor: textColor, fontSize: fontSize,alignment: alignment)
        return lab
    }
    
    class func buttonWithImage(imageName: String?,backImageName: String?) -> UIButton {
        let button = UIButton.buttonWithImage(imageName, backImageName: backImageName)
        return button
    }
    
    class func buttonWithTitle(title: String,backImageName: String?,textColor: UIColor,fontSize: CGFloat,imageName: String? = nil) -> UIButton {
        
        let button = UIButton.buttonWithTitle(title, backImageName: backImageName, textColor: textColor, fontSize: fontSize,imageName: imageName)
        
        return button
    }
    
    
    
    
}




















